package com.atguigu.spzx.product.api.fallback;

import com.alibaba.fastjson.JSON;
import com.atguigu.spyx.model.common.Result;
import com.atguigu.spyx.model.common.com.atguigu.spyx.model.entity.h5.OrderItem;
import com.atguigu.spyx.model.common.com.atguigu.spyx.model.entity.product.ProductSku;
import com.atguigu.spzx.product.api.ProductClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author LT
 * @create 2023-11-20-20:47
 */
@Component
@Slf4j
public class ProductClientFallback implements ProductClient {
    public Result<ProductSku> findById(Long id){
        log.error("远程查询sku详情失败，skuId:{}" , id);
        return Result.fail();
    }

    @Override
    public Result updateSalesAndStock(List<OrderItem> orderItems) {
        log.error("远程更新销量库存失败，orderItems:{}" , JSON.toJSONString(orderItems));
        return Result.fail();
    }
}
